home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / Xi / XListInputDevices.z / XListInputDevices
Text File  |  1998-10-30  |  11KB  |  265 lines

  1.  
  2.  
  3.  
  4.      XXXXLLLLiiiissssttttIIIInnnnppppuuuuttttDDDDeeeevvvviiiicccceeeessss((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXLLLLiiiissssttttIIIInnnnppppuuuuttttDDDDeeeevvvviiiicccceeeessss((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XListInputDevices, XFreeDeviceList - list available input
  10.           devices
  11.  
  12.      SSSSYYYYNNNNTTTTAAAAXXXX
  13.           XDeviceInfo *XListInputDevices(_d_i_s_p_l_a_y, _n_d_e_v_i_c_e_s__r_e_t_u_r_n)
  14.                 Display *_d_i_s_p_l_a_y;
  15.                 int *_n_d_e_v_i_c_e_s__r_e_t_u_r_n;
  16.  
  17.           XFreeDeviceList(_l_i_s_t)
  18.                 XDeviceInfo *_l_i_s_t;
  19.  
  20.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  21.           _d_i_s_p_l_a_y     Specifies the connection to the X server.
  22.  
  23.           _n_d_e_v_i_c_e_s__r_e_t_u_r_n
  24.                       Specifies a pointer to a variable where the
  25.                       number of available devices can be returned.
  26.  
  27.           _l_i_s_t        Specifies the list of devices to free.  The
  28.                       _X_F_r_e_e_D_e_v_i_c_e_L_i_s_t function frees the list of
  29.                       available extension input devices.
  30.  
  31.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  32.           The _X_L_i_s_t_I_n_p_u_t_D_e_v_i_c_e_s request lists the available extension
  33.           input devices.  This list includes the X pointer and X
  34.           keyboard, any other input devices that are currently
  35.           accessible through the X server, and any input devices that
  36.           are not currently accessible through the X server but could
  37.           be accessed if requested.
  38.  
  39.           Some server implementations may make all input devices
  40.           available at the time the server is initialized.  Others may
  41.           wait until requested by a client to access an input device.
  42.           In the latter case, it is possible that an input device will
  43.           be listed as available at one time but not at another.
  44.  
  45.           For each input device available to the server, the
  46.           XListInputDevices request returns an XDeviceInfo structure.
  47.           That structure contains a pointer to a list of structures,
  48.           each of which contains information about one class of input
  49.           supported by the device.
  50.  
  51.           The XDeviceInfo structure is defined as follows:
  52.  
  53.           typedef struct _XDeviceInfo
  54.           {
  55.                XID       id;
  56.                Atom      type;
  57.                char      *name;
  58.                int       num_classes;
  59.                int       use;
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 4/30/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXLLLLiiiissssttttIIIInnnnppppuuuuttttDDDDeeeevvvviiiicccceeeessss((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXLLLLiiiissssttttIIIInnnnppppuuuuttttDDDDeeeevvvviiiicccceeeessss((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.                XAnyClassPtr   inputclassinfo;
  75.           } XDeviceInfo;
  76.  
  77.           The id is a number in the range 0-128 that uniquely
  78.           identifies the device.  It is assigned to the device when it
  79.           is initialized by the server.
  80.  
  81.           The type field is of type Atom and indicates the nature of
  82.           the device.
  83.  
  84.           The name field contains a pointer to a null-terminated
  85.           string that corresponds to one of the defined device types.
  86.           The name will correspond to one of the following strings
  87.           (defined in the header file _X_I._h:
  88.  
  89.           XI_MOUSE XI_TABLET XI_KEYBOARD XI_TOUCHSCREEN XI_TOUCHPAD
  90.           XI_BUTTONBOX XI_BARCODE XI_TRACKBALL XI_QUADRATURE
  91.           XI_ID_MODULE XI_ONE_KNOB XI_NINE_KNOB XI_KNOB_BOX
  92.           XI_SPACEBALL XI_DATAGLOVE XI_EYETRACKER XI_CURSORKEYS
  93.           XI_FOOTMOUSE
  94.  
  95.           These names may be directly compared with the name field of
  96.           the XDeviceInfo structure, or used in an XInternAtom request
  97.           to return an atom that can be compared with the type field
  98.           of the XDeviceInfo structure.
  99.  
  100.           The num_classes field is a number in the range 0-255 that
  101.           specifies the number of input classes supported by the
  102.           device for which information is returned by
  103.           ListInputDevices.  Some input classes, such as class Focus
  104.           and class Proximity do not have any information to be
  105.           returned by ListInputDevices.
  106.  
  107.           The use field specifies how the device is currently being
  108.           used.  If the value is _I_s_X_K_e_y_b_o_a_r_d, the device is currently
  109.           being used as the X keyboard.  If the value is _I_s_X_P_o_i_n_t_e_r,
  110.           the device is currently being used as the X pointer.  If the
  111.           value is _I_s_X_E_x_t_e_n_s_i_o_n_D_e_v_i_c_e, the device is available for use
  112.           as an extension device.
  113.  
  114.           The inputclassinfo field contains a pointer to the first
  115.           input-class specific data.  The first two fields are common
  116.           to all classes.
  117.  
  118.           The class field is a number in the range 0-255.  It uniquely
  119.           identifies the class of input for which information is
  120.           returned.  Currently defined classes are KeyClass,
  121.           ButtonClass, and ValuatorClass.
  122.  
  123.           The length field is a number in the range 0- 255. It
  124.           specifies the number of bytes of data that are contained in
  125.           this input class.  The length includes the class and length
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 4/30/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXLLLLiiiissssttttIIIInnnnppppuuuuttttDDDDeeeevvvviiiicccceeeessss((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXLLLLiiiissssttttIIIInnnnppppuuuuttttDDDDeeeevvvviiiicccceeeessss((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.           fields.
  141.  
  142.           The XKeyInfo structure describes the characteristics of the
  143.           keys on the device.  It is defined as follows:
  144.  
  145.           typedef struct _XKeyInfo {
  146.                XID            class;
  147.                int            length;
  148.                unsigned short      min_keycode;
  149.                unsigned short      max_keycode;
  150.                unsigned short      num_keys;
  151.           } XKeyInfo;
  152.  
  153.           min_keycode is of type KEYCODE.  It specifies the minimum
  154.           keycode that the device will report.  The minimum keycode
  155.           will not be smaller than 8.
  156.  
  157.           max_keycode is of type KEYCODE.  It specifies the maximum
  158.           keycode that the device will report.  The maximum keycode
  159.           will not be larger than 255.
  160.  
  161.           num_keys specifies the number of keys that the device has.
  162.  
  163.           The XButtonInfo structure defines the characteristics of the
  164.           buttons on the device.  It is defined as follows:
  165.  
  166.           typedef struct _XButtonInfo {
  167.                XID       class;
  168.                int       length;
  169.                short          num_buttons;
  170.           } XButtonInfo;
  171.  
  172.           num_buttons specifies the number of buttons that the device
  173.           has.
  174.  
  175.           The XValuatorInfo structure defines the characteristics of
  176.           the valuators on the device.  It is defined as follows:
  177.  
  178.           typedef struct _XValuatorInfo {
  179.                XID            class;
  180.                int            length;
  181.                unsigned char       num_axes;
  182.                unsigned char       mode;
  183.                unsigned long       motion_buffer;
  184.                XAxisInfoPtr        axes;
  185.           } XValuatorInfo;
  186.           num_axes contains the number of axes the device supports.
  187.  
  188.           mode is a constant that has one of the following values:
  189.           Absolute or Relative.  Some devices allow the mode to be
  190.           changed dynamically via the SetDeviceMode request.
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 4/30/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      XXXXLLLLiiiissssttttIIIInnnnppppuuuuttttDDDDeeeevvvviiiicccceeeessss((((3333XXXX11111111))))XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....3333))))XXXXLLLLiiiissssttttIIIInnnnppppuuuuttttDDDDeeeevvvviiiicccceeeessss((((3333XXXX11111111))))
  203.  
  204.  
  205.  
  206.           motion_buffer_size is a cardinal number that specifies the
  207.           number of elements that can be contained in the motion
  208.           history buffer for the device.
  209.  
  210.           The axes field contains a pointer to an XAxisInfo structure.
  211.  
  212.           The XAxisInfo structure is defined as follows:
  213.  
  214.           typedef struct _XAxisInfo {
  215.                int  resolution;
  216.                int  min_value;
  217.                int  max_value;
  218.           } XAxisInfo;
  219.  
  220.           The resolution contains a number in counts/meter.
  221.  
  222.           The min_val field contains a number that specifies the
  223.           minimum value the device reports for this axis.  For devices
  224.           whose mode is Relative, the min_val field will contain 0.
  225.  
  226.           The max_val field contains a number that specifies the
  227.           maximum value the device reports for this axis.  For devices
  228.           whose mode is Relative, the max_val field will contain 0.
  229.  
  230.           To free the _X_D_e_v_i_c_e_I_n_f_o array created by _X_L_i_s_t_I_n_p_u_t_D_e_v_i_c_e_s,
  231.           use _X_F_r_e_e_D_e_v_i_c_e_L_i_s_t.
  232.  
  233.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  234.           none.
  235.  
  236.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  237.           _P_r_o_g_r_a_m_m_i_n_g _w_i_t_h _X_l_i_b
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                                          (printed 4/30/98)
  262.  
  263.  
  264.  
  265.